SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE PROCEDURE dbo.[DnnProduct_CoreMessaging_DeleteNotificationType]
	@NotificationTypeID int
AS
BEGIN
	-- First delete related data
	DELETE
	FROM dbo.[DnnProduct_CoreMessaging_Messages]
	WHERE [NotificationTypeID] = @NotificationTypeID
	
	DELETE
	FROM dbo.[DnnProduct_CoreMessaging_NotificationTypeActions]
	WHERE [NotificationTypeID] = @NotificationTypeID

	-- Finally delete the Notification type
	DELETE
	FROM dbo.[DnnProduct_CoreMessaging_NotificationTypes]
	WHERE [NotificationTypeID] = @NotificationTypeID
END
GO
